package cn.itcast.entity;

import java.io.Serializable;

/**
 * 考试界面显示：用户、考试科目，考试时间，题目数量
 */
public class ExamInfo implements Serializable {

    private static final long serialVersionUID = 7171922215075641740L;
    /**
     * 考试科目
     * 默认值：JavaSE阶段性考试（一）
     */
    private String title;
    /**
     * 登录用户信息
     */
    private User user;
    /**
     * 考试时长
     * 分钟为单位
     * 默认值：5（分钟）
     */
    private int timeLimit;

    /**
     * 题目的数量
     */
    private int questionCount;

    public ExamInfo() {
    }

    public ExamInfo(String title, User user, int timeLimit, int questionCount) {
        super();
        this.title = title;
        this.user = user;
        this.timeLimit = timeLimit;
        this.questionCount = questionCount;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public int getTimeLimit() {
        return timeLimit;
    }

    public void setTimeLimit(int timeLimit) {
        this.timeLimit = timeLimit;
    }

    public int getQuestionCount() {
        return questionCount;
    }

    public void setQuestionCount(int questionCount) {
        this.questionCount = questionCount;
    }


    @Override
    public String toString() {
        if (user == null)
            return "无信息!";
        return "姓名: " + user.getUserName()+
                "    编号: " + user.getId() +
                "    考试时间: " + timeLimit + "分钟" +
                "    考试科目: " + title +
                "    题目数量: " + questionCount;
//        return "姓名: XXX" +
//                "    编号: XXX" +
//                "    考试时间: XXX" +
//                "    考试科目: XXX" +
//                "    题目数量: XXX";
    }
}
